package com.yadang.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.crypto.interfaces.PBEKey;

/**
 * @author: 亚当
 * @date: 2022年09月05日 21:21
 * @package: com.yadang.springcloud.controller
 * @Description: TODO
 */
@RestController
public class OrderConsulController {
    public static final String INVORK_URL="http://consul-provider-payment";
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/consumer/payment/consul")
    public String paymentInfo(){
        String result = restTemplate.getForObject(INVORK_URL + "/payment/consul", String.class);
        System.out.println("消费者调用支付服务(consule)--->result:" + result);
        return result;
    }
}
